//
//  ResultViewController.m
//  XiangCaoJiaYuan
//
//  Created by tongj on 2017/8/18.
//  Copyright © 2017年 tongj. All rights reserved.
//

#import "ResultViewController.h"
#import "UIButton+LT.h"
#import "MineViewController.h"
@interface ResultViewController ()
@property(nonnull,strong)UIImageView* RedimgView;
@end

@implementation ResultViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createUI];
}
-(void)createUI
{
    
    _RedimgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,UIScreen_WIDTH, UIScreen_HEIGHT)];
    _RedimgView.image = [UIImage imageNamed:@"E839B"];
    _RedimgView.userInteractionEnabled = YES;
    [self.view addSubview:_RedimgView];
    
    UIView* WhiteView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, UIScreen_WIDTH, 64)];
    WhiteView.backgroundColor = [UIColor whiteColor];
    [_RedimgView addSubview:WhiteView];
    
    UILabel* lab = [[UILabel alloc]initWithFrame:CGRectMake(0,28*HEIGHT, UIScreen_WIDTH, 18*HEIGHT)];
    lab.textAlignment = NSTextAlignmentCenter;
    lab.text = @"香草园地";
    lab.textColor = color333333;
//    lab.font = [UIFont fontWithName:@ "Arial Rounded MT Bold"size:18*WIDTH];
    lab.font = [UIFont systemFontOfSize:18*WIDTH];
    [WhiteView addSubview:lab];
    
    
    UILabel* Visitlab = [[UILabel alloc]initWithFrame:CGRectMake(12*WIDTH ,WhiteView.frame.size.height+19*HEIGHT,200*WIDTH, 15*HEIGHT)];
    Visitlab.textAlignment = NSTextAlignmentLeft;
    Visitlab.text = @"1558人光临我的店铺";
    Visitlab.textColor = color3cb83a;
    Visitlab.font = [UIFont fontWithName:@ "Arial-BoldMT"size:18*WIDTH];
    [_RedimgView addSubview:Visitlab];
    
    UIButton* but = [UIButton buttonWithType:UIButtonTypeCustom];
    but.frame = CGRectMake(UIScreen_WIDTH-101*WIDTH,WhiteView.frame.size.height+18*HEIGHT,93*WIDTH,HEIGHT*35);
    [but setImage:[UIImage imageNamed:@"倒计时_03(1)"] forState:UIControlStateNormal];
    [but addTarget:self action:@selector(Click) forControlEvents:UIControlEventTouchUpInside];
    [_RedimgView addSubview:but];

    for (int i =0; i<4; i++) {
        
        UIImageView* image = [[UIImageView alloc]initWithFrame:CGRectMake(12*WIDTH+33*WIDTH*i, WhiteView.frame.size.height+19*HEIGHT+Visitlab.frame.size.height+10*HEIGHT, 30*WIDTH,30*WIDTH )];
        image.backgroundColor =color3cb83a;
        
        image.layer.masksToBounds = YES;
        image.layer.cornerRadius = 15*WIDTH;
        [_RedimgView addSubview:image];
    }

    //    香草园地_14
    UIButton*butMM = [UIButton buttonWithType:UIButtonTypeCustom];
    butMM.frame = CGRectMake(UIScreen_WIDTH-95*WIDTH,UIScreen_HEIGHT-250*HEIGHT,95*WIDTH,HEIGHT*50);
    [butMM setImage:[UIImage imageNamed:@"香草园地_14"] forState:UIControlStateNormal];
    [butMM addTarget:self action:@selector(ButMM) forControlEvents:UIControlEventTouchUpInside];
    [_RedimgView addSubview:butMM];
    
    UIImageView* imgViewPerson = [[UIImageView alloc]initWithFrame:CGRectMake(10,UIScreen_HEIGHT-10-73*HEIGHT,73*WIDTH,HEIGHT*73)];
    imgViewPerson.image = [UIImage imageNamed:@"香草园地_10"];
    [_RedimgView addSubview:imgViewPerson];
    
    UILabel* RedCanYuLab = [[UILabel alloc]initWithFrame:CGRectMake(12*WIDTH ,UIScreen_HEIGHT-169*HEIGHT,119*WIDTH, 21*HEIGHT)];
    RedCanYuLab.textAlignment = NSTextAlignmentCenter;
    RedCanYuLab.text = @"1558人光临我的店铺";
    RedCanYuLab.font = [UIFont systemFontOfSize:10*WIDTH];
    RedCanYuLab.textColor = [UIColor whiteColor];
    RedCanYuLab.backgroundColor = colorf2a002;
    RedCanYuLab.layer.masksToBounds = YES;
    RedCanYuLab.layer.cornerRadius = 21/2*WIDTH;
    [_RedimgView addSubview:RedCanYuLab];
    
    
    UILabel* ChouCanYuLab = [[UILabel alloc]initWithFrame:CGRectMake(UIScreen_WIDTH-12*WIDTH-119*WIDTH ,UIScreen_HEIGHT-169*HEIGHT,119*WIDTH,21*HEIGHT)];
    ChouCanYuLab.textAlignment = NSTextAlignmentCenter;
    ChouCanYuLab.text = @"抽奖总参与45994人";
    ChouCanYuLab.font = [UIFont systemFontOfSize:10*WIDTH];
    ChouCanYuLab.textColor = [UIColor whiteColor];
    ChouCanYuLab.backgroundColor = HEXRGB(0xa4b8b4);
    ChouCanYuLab.layer.masksToBounds = YES;
    ChouCanYuLab.layer.cornerRadius = 21/2*WIDTH;
    [_RedimgView addSubview:ChouCanYuLab];
    
    NSArray* arr = @[@"我的",@"发布",@"消息",@"帮助"];
    for (int i =0; i<4; i++) {
        
        UILabel* lab = [[UILabel alloc]initWithFrame:CGRectMake(10+imgViewPerson.frame.size.width+WIDTH*18+75*WIDTH*i, UIScreen_HEIGHT-25*HEIGHT,35*WIDTH, 15*HEIGHT)];
        lab.font = [UIFont systemFontOfSize:15*HEIGHT];
        lab.text = arr[i];
        lab.adjustsFontSizeToFitWidth = YES;
        lab.textColor = color333333;
        [_RedimgView addSubview:lab];
        
    }
    NSArray* arrBut = @[@"我的-",@"发布-",@"消息-",@"帮助.-"];
    for (int i =0; i<4; i++) {
        
        UIButton* imgBut = [UIButton buttonWithType:UIButtonTypeCustom];
        imgBut.tag = i+1;
        [imgBut setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arr[i]]] forState:UIControlStateNormal];
        [imgBut setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",arrBut[i]]] forState:UIControlStateHighlighted];
        imgBut.frame = CGRectMake(10+imgViewPerson.frame.size.width+WIDTH*17+75*WIDTH*i, UIScreen_HEIGHT-25*HEIGHT-8-32*HEIGHT, 32*WIDTH,32*HEIGHT);
        [imgBut addTarget:self action:@selector(Imgclick:) forControlEvents:UIControlEventTouchUpInside];
        [_RedimgView addSubview:imgBut];
    }

}
-(void)Click
{
    ResultViewController* resVC = [[ResultViewController alloc]init];
    [self presentViewController:resVC animated:YES completion:nil];
}
#pragma mark 美眉窗口
-(void)ButMM
{
    
}
-(void)Imgclick:(UIButton*)sender
{
    if (sender.tag ==1) {
        NSLog(@"我的界面");
        MineViewController* MineVC = [[MineViewController alloc]init];
        [self.navigationController pushViewController:MineVC animated:NO];
    }
    else if (sender.tag==2){
        NSLog(@"发布界面");
    }else if (sender.tag==3){
        NSLog(@"消息界面");
    }else
    {
        NSLog(@"帮助界面");
    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
